package com.xdtech.hotel.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.hotel.model.TestData;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-06-05 14:18:20
 * @since 1.0
 * @see
 */
public class TestDataItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="软件接收数据",width=100)
	private String receData;
	@GridColumn(title="软件反馈数据",width=100)
	private String returnData;

	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setReceData(String receData) {
		this.receData = receData;
		addQuerys("receData", receData);
	}
	public String getReceData() {
		return receData;
	}
	
	public void setReturnData(String returnData) {
		this.returnData = returnData;
		addQuerys("returnData", returnData);
	}
	public String getReturnData() {
		return returnData;
	}
	
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static TestDataItem createItem(TestData testData) {
		TestDataItem testDataItem = new TestDataItem();
		BeanUtils.copyProperties(testDataItem, testData);
		//自定义属性设置填充
		return testDataItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<TestDataItem> createItems(List<TestData> testDatas) {
		List<TestDataItem> testDataItems = new ArrayList<TestDataItem>();
		for (TestData testData : testDatas) {
			testDataItems.add(createItem(testData));
		}
		return testDataItems;
	}
}
